// 引入request
import request from '@/utils/request'

// 封装 注册请求 方法
export const register = data => {
  return request.post('user/registered', data)
}

// 封装 登录请求 方法
export const login = data => {
  return request.post('user/login', data)
}

// 封装 收藏请求的方法
export const favorites = () => {
  return request.get('/user/favorites')
}

// 获取用户信息
export const userMessage = () => {
  return request.get('/user')
}

// 获取城市列表
export const areaCity = params => {
  return request.get('/area/city', { params })
}

// 获取热门城市
export const hotCity = () => {
  return request.get('/area/hot')
}

// 根据ID查询城市信息
export const cityMessage = params => {
  return request.get('/area', { params })
}

// 查看已发布的房源
export const houseMessage = () => {
  return request.get('/user/houses')
}
